package ui;

import javax.swing.*;
import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * User: grigory.rozhkov
 * Date: 12.09.12
 * Time: 0:36
 * To change this template use File | Settings | File Templates.
 */
public class MainFrame extends JFrame {
    private MainPanel mainPanel;

    public MainFrame() {
        this.setSize(300, 100);
        this.setTitle("DBServer");
        this.setResizable(false);
        showMainPanel();
    }

    private void showMainPanel() {
        if (mainPanel != null) {
            mainPanel.setVisible(false);
        }
        Container contentPane = this.getContentPane();
        contentPane.removeAll();
        mainPanel = new MainPanel(this.getWidth(), this.getHeight());
        contentPane.add(mainPanel);
        contentPane.setVisible(true);
    }
}
